package TutorielChevalier;

/**
 * Write a description of class Chevalier here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Chevalier
{
    // instance variables - replace the example below with your own
    private int x;
    
    private int vie;
    private int mana;
    private String nom;

    public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	/**
     * Constructor for objects of class Chevalier
     */
    public Chevalier()
    {
        // initialise instance variables
        x = 0;
    }
    
    public int getVie()
    {
        return vie;
    }
    
    public void setVie(int v)
    {
		if(v >= 0)
			vie = v;
		else
			vie = 0;
    }
    
    public int getMana()
    {
        return mana;
    }
    
    public void setMana(int m)
    {
        if(m >= 0)
			mana = m;
		else
			mana = 0;
    }
    
    public void autoHeal()
    {
        megaAutoHeal();
    }
	
	public void megaAutoHeal()
	{
		if(mana >= 10)
		{
			mana -= 10;
			vie += 10;
		}
	}
	
    /**
     * An example of a method - replace this comment with your own
     * 
     * @param  y   a sample parameter for a method
     * @return     the sum of x and y 
     */
    public int sampleMethod(int y)
    {
        // put your code here
        return x + y;
    }
}
